#ifndef TZUDPCLIENT_H
#define TZUDPCLIENT_H

#include <QObject>
#include <QThread>
#include <QImage>
#include <QUdpSocket>
#include "parse_thread.h"
class TzUdpClient : public QObject
{
    Q_OBJECT
public:
    explicit TzUdpClient(QObject *parent = nullptr);


    void readyData();

public slots:
    void sendData(char*,int);

    void slotRecvPhotoInfoBackResponsePackage(QImage);
signals:
    void signRecvPhotoInfoBackResponsePackage(QImage);
private:
    void parse(QByteArray);
private:
    QByteArray      m_dataCache;
    QUdpSocket*     m_Client;
    int             m_dataSize = 0;
    ParseThread*    m_parseThread;
    char *          m_datagram;
    QHostAddress    m_ipAddr;
    quint16         m_port;
};

#endif // TZUDPCLIENT_H
